package com.cheer.vo;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息
 * 
 * @author cheer
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@ApiModel("讲座列表")
public class LecCourseVO implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty("主键值")
	private Integer id;

	@ApiModelProperty("教师名称")
	private String teacherName;

	@ApiModelProperty("演讲主题")
	private String title;

	@ApiModelProperty("演讲时间")
	private String lectureTime;

	@ApiModelProperty("演讲时间")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date startTime;

	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date endTime;

	private Integer count;

	private String address;

	private String department;

	@ApiModelProperty("状态")
	private Integer status;

	@ApiModelProperty("宣讲模式")
	private Integer model;

	@ApiModelProperty("宣讲模式中文转义")
	private String modelStr;

	private String note;

	private String path;

	private String orgStr;

	private String teaDepartment;

	private String belong;

	private String belongsStr;


	public void assembleLectureTime(){

		String lectureTime = DateUtil.formatDate(this.getStartTime()) + " " + DateUtil.formatTime(this.getStartTime()) +
				"-" + DateUtil.formatDate(this.getEndTime()) + " " + DateUtil.formatTime(this.getEndTime());

		this.setLectureTime(lectureTime);
	}

	public void setModelStr(){

		if(ObjectUtil.isNull(model)){

			return;
		}
		if(model == 0){

			this.modelStr = "线下";
		}
		if(model == 1){

			this.modelStr = "线上";
		}

	}


}
